<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?=gurl('css');?>/admin.css" />
<script language="javascript" src="<?=gurl('js');?>/common.js"></script>
<script src="<?=gurl('js');?>/my97/WdatePicker.js"></script>
</head>
<body>
	<h3 style="background:#E5ECF3; padding:5px; font-size:12px;">> <a href="<?=site_url(rnadminpath().'/main/show/main');?>">首页</a> > <a href="#">编辑广告</a></h3>
	<div style="margin-top:10px;padding:5px;border:1px solid #9FACB7;">
	<form action="" method="POST" onSubmit="return Validator.Validate(this,2);" enctype="multipart/form-data">
		<ul class="additem" style="width:450px;text-align:right;">
			<li>广告位：<select name="placeid" id="placeid">
			<option value="0">请选择广告位</option>
			<? foreach ($places as $place):?>
			<option <? if($row["placeid"] == $place["placeid"]):?> selected <? endif;?> value="<?=$place["placeid"];?>"><?=$place["placename"];?></option>
			<? endforeach;?>
			</select></li>
			<li>广告名称：<input class="textinput" type="text" name="adsname" id="adsname" value="<?=$row['adsname'];?>" dataType="Require" msg="请输入名称" /></li>
			<li>广告内容：<input class="textinput" type="file" name="	imageurl" id="imageurl"  value="<?=$row['imageurl'];?>" /></li>
			<li>广告链接：<input class="textinput" type="text" name="	linkurl" id="linkurl" value="<?=$row['linkurl'];?>" dataType="Require" msg="请输入链接" /></li>
			<li>发布日期：<input class="textinput" type="text" name="fromdate" id="fromdate" <? if($row['fromdate']):?>value="<?=date('Y-m-d',$row['fromdate']);?>"<? endif;?> onClick="WdatePicker()" dataType="Require" msg="请输入发布日期" /></li>
			<li>结束日期：<input class="textinput" type="text" name="todate" id="todate" <? if($row['todate']):?>value="<?=date('Y-m-d',$row['todate']);?>"<? endif;?> onClick="WdatePicker()" /></li>
			<li>是否启用：<input  type="radio" name="passed" id="passed" value="1" <? if($row['passed'] == '1'):?>checked<? endif;?> />是&nbsp;<input  type="radio" name="passed" id="passed" value="0" <? if($row['passed'] == '0'):?>checked<? endif;?> />否&nbsp;</li>
			<? if($current_place['forsite'] == '1'):?>
			<li>应用小站：
				<? if(is_array($sites) && count($sites)>0):?>
					<? foreach ($sites as $site):?>
						<?=$site['name'];?>,
					<? endforeach;?>
				<? else:?>
					所有小站
				<? endif;?>
			</li>
			<? endif;?>
			<li><input type="submit" name="dosubmit" id="dosubmit" value="编辑">
			<input type="button" onclick="window.history.go(-1);" value="返回">
			</li>
		</ul>
		<input type="hidden" name="adsid" id="adsid" value="<?=$row['adsid'];?>">
	</form>
	</div>
</body>
</html>
